<template>
  <div class="info_bg">
    <div class="transportInfo" id="transportBusiness">
      <div class="wrap">
        <div>
          <h1>联运商情</h1>
          <p>TRANSPORTATION INFORMATION</p>
        </div>
        <Tabs v-model="currentName">
          <TabPane label="货源" name="1">
          </TabPane>
          <TabPane label="运力" name="2">
          </TabPane>
          <!--<TabPane label="箱源" name="3">
          </TabPane>-->
          <TabPane label="仓储" name="4">
          </TabPane>
          <!--<TabPane label="招标公告" name="5">
          </TabPane>-->
          <TabPane label="金融保理" name="6">
          </TabPane>
        </Tabs>
        <keep-alive>
          <!--货源-->
          <Card v-if="currentName=='1'">
            <sourceOfGoods :cityList="cityList"></sourceOfGoods>
          </Card>
        </keep-alive>

        <keep-alive>
          <!-- 运力 -->
          <Card v-if="currentName=='2'">
            <capacity :cityList="cityList"></capacity>
          </Card>
        </keep-alive>

        <!--<keep-alive>
          &lt;!&ndash; 箱源 &ndash;&gt;
          <Card v-if="currentName=='3'">
            <sourceOfContainer :cityList="cityList"></sourceOfContainer>
          </Card>
        </keep-alive>-->

        <keep-alive>
          <!--仓储-->
          <Card v-if="currentName=='4'">
            <storage></storage>
          </Card>
        </keep-alive>

        <!--<keep-alive>
          &lt;!&ndash;招标公告&ndash;&gt;
          <Card v-if="currentName=='5'">
            <tenderMsg></tenderMsg>
          </Card>
        </keep-alive>-->

        <keep-alive>
          <!--金融保理-->
          <Card v-if="currentName=='6'">
            <financeFactoring></financeFactoring>
          </Card>
        </keep-alive>
      </div>
    </div>
    <div style="clear:both"></div>
  </div>
</template>
<script>
  import storage from './storage.vue'
  import sourceOfGoods from './sourceOfGoods.vue'
  import capacity from './capacity.vue'
  /* import sourceOfContainer from './sourceOfContainer.vue' */
  /* import tenderMsg from './tenderMsg.vue' */
  import financeFactoring from './financeFactoring.vue'
  import { getCityList } from '@api/backEnd/productDemand'

  export default {
    name: 'transportBusiness',
    data () {
      let currentName = '1'
      let cityList = []
      let datas = { currentName, cityList }
      return datas
    },
    methods: {
      /**
       * 点击Tabs切换
       * @param val
       */
      tabClick (val) {
        if (!val) {
          val = this.currentName
        } else {
          this.currentName = val
        }
      },
      /**
       * 获得城市列表
       * @param
       * @date 2018/2/18 10:01
       **/
      getCityData () {
        getCityList().then(res => {
          if (res.data.isSuccess === 1) {
            res.data.data.unshift({
              label: '全国',
              value: ''
            })
            this.cityList = res.data.data
          }
        })
      }
    },
    mounted () {
      this.getCityData()
    },
    /* components: { storage, sourceOfGoods, capacity, sourceOfContainer, tenderMsg, financeFactoring } */
    components: { storage, sourceOfGoods, capacity, financeFactoring }
  }
</script>
<style scoped>
  .info_bg {
    background-image: url("../../../../../static/img/img_homebg01.png");
    background-color: #FFFFFF;
    padding-bottom: 20px;
    padding-top: 80px;
  }

  .transportInfo {
    height: 100%;
    margin: 0 auto;
    width: 960px;
  }

  .wrap {
    width: 100%;
    margin: 0px auto;
  }
</style>
